/**
 * Created with IntelliJ IDEA.
 * Description:
 * User: wwy
 * Date: 2024-05-19
 * Time: 8:57
 */
public class TestDemo {
    public static void main(String[] args) {
        //创建父类对象，当作参数传入到子类中
        Test2 t = new Test2();
        Sub_Test st = new Sub_Test(t);
        //子类调用父类的方法
        st.fly();
        System.out.println(t.name);
    }
}

